{% include "repo/public/header-menu.njk" %}
{% set avatar_url = ROOT + "manage/user/info/avatar/" + user.username %}
<div class="Box mt-3">
    <div class="Box-header position-relative">
        <div class="d-flex flex-items-center width-full">
            <a class="mr-2 avatar-3" href="{{ROOT}}{{ user.username }}">
                <img class="avatar-3 circle" src="{{avatar_url}}" alt="">
            </a>
            <a class="Link--primary mr-1 text-bold" href="{{ repo.latest_commit.username }}">{{ repo.latest_commit.username }}</a>
            <a class="Link--primary d-none d-md-inline width-full no-wrap overflow-hidden" style="text-overflow: ellipsis;" href="#url">Update {{ repo.latest_commit.comment }}</a>
            <div class="flex-shrink-0 mr-0 ml-auto">
                <div class="d-inline-block mr-1">
                    <svg aria-label="1 / 1 checks OK" role="img" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-check">
                        <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
                    </svg>
                </div>
                <a class="Link--primary mr-1 f6 color-fg-subtle" href="#url">{{ repo.latest_commit.hash }}</a>
                <a class="Link--primary mr-2 f5 no-wrap color-fg-subtle" href="#url">{{ repo.latest_commit.relative_time }}</a>
                <a class="Link--primary no-underline mr-1 f5" href="#url">
                    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-history">
                        <path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path>
                    </svg>
                    {{ repo.latest_commit.total }}
                    <span class="color-fg-subtle">commit</span>  
                </a>
            </div>
        </div>
    </div>
    <div>
        {% for item in repo.fileList %}
        <!-- class navigation-focus -->
        <div class="Box-row d-flex py-2 Box-row--focus-gray">
            <div class="mr-3 flex-shrink-0">
                {% if item.type === "tree" %}
                <svg class="color-fg-accent octicon" aria-label="Directory" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file-directory hx_color-icon-directory">
                    <path fill-rule="evenodd" d="M1.75 1A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3h-6.5a.25.25 0 01-.2-.1l-.9-1.2c-.33-.44-.85-.7-1.4-.7h-3.5z"></path>
                </svg>
                {% else %}
                <svg aria-label="File" aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-file color-fg-muted">
                    <path fill-rule="evenodd" d="M3.75 1.5a.25.25 0 00-.25.25v11.5c0 .138.112.25.25.25h8.5a.25.25 0 00.25-.25V6H9.75A1.75 1.75 0 018 4.25V1.5H3.75zm5.75.56v2.19c0 .138.112.25.25.25h2.19L9.5 2.06zM2 1.75C2 .784 2.784 0 3.75 0h5.086c.464 0 .909.184 1.237.513l3.414 3.414c.329.328.513.773.513 1.237v8.086A1.75 1.75 0 0112.25 15h-8.5A1.75 1.75 0 012 13.25V1.75z"></path>
                </svg>
                {% endif %}
            </div>
            <div class="col-md-2 flex-shrink-0 mr-2">
                {% if item.type === "tree" %}
                <a class="Link--primary mr-1" href="{{ROOT}}{{ user.username }}/{{ repo.name }}/tree/{{ repo.branch }}/{{ item.url }}">{{ item.name }}</a>
                {% else %}
                <a class="Link--primary mr-1" href="{{ROOT}}{{ user.username }}/{{ repo.name }}/blob/{{ repo.branch }}/{{ item.url }}">{{ item.name }}</a>
                {% endif %}
            </div>
            <div class="flex-auto width-full overflow-hidden no-wrap col-md-5" style="text-overflow: ellipsis;">
                <a class="Link--primary color-fg-subtle mr-1" href="#url">{{ item.comment }}</a>
            </div>
            <div class="flex-shrink-0 color-fg-subtle text-right">
                {{ item.relative_time }}
            </div>
        </div>
        {% endfor %}
    </div>
</div>